﻿@model DistanceLearning.Models.ExamTestQuestion

<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("CreateOpenQuestion", "ExamTest", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    @Html.Hidden("IsOpenQuestion", true)
    @Html.HiddenFor(x => x.ExamTestID)
    <fieldset>
        <legend>Вопрос</legend>

        <div class="editor-label">
            @Html.Label("Текст вопроса")
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Body)
            @Html.ValidationMessageFor(model => model.Body)
        </div>
        <div class="editor-label">
            @Html.Label("Количество баллов за вопрос")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Cost)
            @Html.ValidationMessageFor(model => model.Cost)
        </div>

        <script type="text/javascript">
            var element = document.createElement('div');
            document.body.appendChild(element);
        </script>

@*        <div class="editor-label">
            @Html.Label("Доступно несколько правильных ответов")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.AllowMultiAnswer)
            @Html.ValidationMessageFor(model => model.AllowMultiAnswer)
        </div>*@

        <table>
            <tr>
                <th>Вариант ответа</th>
                <th>Верный</th>
            </tr>

            <tr><td><input type="text" name="variants[0]" /></td><td><input type="checkbox" name="corrected" value="0" /></td></tr>
            <tr><td><input type="text" name="variants[1]" /></td><td><input type="checkbox" name="corrected" value="1" /></td></tr>
            <tr><td><input type="text" name="variants[2]" /></td><td><input type="checkbox" name="corrected" value="2" /></td></tr>
            <tr><td><input type="text" name="variants[3]" /></td><td><input type="checkbox" name="corrected" value="3" /></td></tr>
            <tr><td><input type="text" name="variants[4]" /></td><td><input type="checkbox" name="corrected" value="4" /></td></tr>
            
        </table>

        <b>Загрузить изображения к тесту</b><br />
        <p>
            <input type="file" name="fileUpload[0]" /><br />
            <input type="file" name="fileUpload[1]" /><br />
            <input type="file" name="fileUpload[2]" /><br />
        </p>

        <p>
            <input type="submit" name="Submit" id="SubmitMultiply" value="Создать" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
